<template>
  <div class="card">
    <div class="card-head">
      <div class="card-head-icon-box">
        <div :class="['card-head-icon', icon]"></div>
      </div>
        <div class="card-head-text">
            <div class="card-title">
              {{ title }}
            </div>
            <div class="card-subtitle">
              <slot name="right"></slot>
            </div>
        </div>
    </div>
    <div class="card-body">
      <slot></slot>
    </div>
  </div>
</template>
<style lang="less">
.card {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    flex-direction:column;
  pointer-events: auto;

  .card-head {
    height: 40px;
    line-height: 40px;
    display: flex;
    align-items: center;
    background-color: rgba(0, 147, 167, .4);
    .card-head-icon-box {
      width: 40px;
      flex-shrink: 0;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .card-head-icon {
        width: 24px;
        height: 24px;
        background-size: 100% 100%;
        background-repeat: no-repeat;
    }
    .icon1 {
      background-image: url("~@/assets/icon/icon1.png");
    }
    .icon2 {
      background-image: url("~@/assets/icon/icon2.png");
    }
    .icon3 {
      background-image: url("~@/assets/icon/icon3.png");
    }
    .icon4 {
      background-image: url("~@/assets/icon/icon4.png");
    }
    .icon5 {
      background-image: url("~@/assets/icon/icon5.png");
    }
    .icon6 {
      background-image: url("~@/assets/icon/icon6.png");
    }
    .card-head-text {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-left: 10px;
        padding-right: 10px;
        flex-grow: 1;
    }
    .card-title {
        height: 21px;
        font-size: 18px;
        line-height: 21px;
        font-family: Source Han Sans CN-Medium, Source Han Sans CN;
        font-weight: 500;
        color: #55C1FF;
    }
    .card-subtitle {
        font-size: 14px;
        line-height: 14px;
        margin-top: 8px;
        font-family: Source Han Sans CN-Medium, Source Han Sans CN;
        font-weight: 500;
        color: #41A0D2;
        margin-left: 10px;
    }
  }
  .card-body {
    flex-grow: 1;
      background-color: rgba(0, 147, 167, .2);
      padding: 18px;
  }
}
</style>
<script>
export default {
  props: {
    title: String,
    subtitle: String,
    icon: String
  }
}
</script>
